INCLUDE_DIRECTORIES("${ATOM3D_INCLUDE_DIR}")
INCLUDE_DIRECTORIES("${ATOM3D_INCLUDE_DIR}/geometry")
INCLUDE_DIRECTORIES("${THIRDPART_DIR}/include/maya2012sdk")
LINK_DIRECTORIES("${THIRDPART_DIR}/lib/maya2012sdk")
LINK_DIRECTORIES("${THIRDPART_DIR}/lib/tinyxml")

AUX_SOURCE_DIRECTORY(.. ExporterSrc)
FILE(GLOB ExporterHeaders ../*.h)

ADD_DEFINITIONS(/D_BOOL /DREQUIRE_IOSTREAM /wd4244)

STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})

SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:msvcrtd.lib")

IF(DEFINED PC_LINT_ENABLE)
	set(PC_LINT_OPT_DIR ${TOPLEVEL_DIR}/)
	set(PC_LINT_USER_FLAGS "-b")
	if (COMMAND add_pc_lint)
	  add_pc_lint(ATOM_maya2012_exporter2 ${ExporterSrc})
	endif (COMMAND add_pc_lint)
ENDIF(DEFINED PC_LINT_ENABLE)

ADD_LIBRARY(ATOM_maya2012_exporter2
	SHARED 
	${ExporterSrc} 
	${TOPLEVEL_DIR}/src/geometry/vcache.cpp
	${TOPLEVEL_DIR}/src/geometry/aabbtree.cpp
	${TOPLEVEL_DIR}/src/geometry/aabbtreebuilder.cpp
	${TOPLEVEL_DIR}/src/geometry/nvmeshmender.cpp
	${TOPLEVEL_DIR}/src/geometry/ray.cpp
	${ExporterHeaders} 
	../ATOM_mayaexporter.rc
)

SET_TARGET_PROPERTIES(ATOM_maya2012_exporter2 PROPERTIES 
	SUFFIX ".mll" 
)

ADD_DEPENDENCIES(ATOM_maya2012_exporter2 ATOM_geometry)
TARGET_LINK_LIBRARIES(ATOM_maya2012_exporter2 comctl32.lib Foundation.lib OpenMaya.lib OpenMayaAnim.lib)

INSTALL_TARGET(ATOM_maya2012_exporter2)

# IF (MAYA2008_PLUGIN_PATH)
#  INSTALL(TARGETS ATOM_maya2012_exporter2 RUNTIME DESTINATION ${MAYA2008_PLUGIN_PATH})
# ENDIF (MAYA2008_PLUGIN_PATH)
